#include "filemanagercommand.h"
//#include "IO_FcCameraAbstract_Proxy.hpp"
//#include "fileuploadeventcommand.h"
#include <cstdio>
#include <fcntl.h>
#include <unistd.h>
#include "sys/stat.h"
#include "eventloop.h"
#include "json/json.h"
#include "data_build.h"

L3FileManager FileManagerCommand::m_l3FileManagerInstance;

FileManagerCommand::FileManagerCommand()
{
    // m_ImgCollectinstance = MiddleCollect::getDelayedInstance();
}

FileManagerCommand::~FileManagerCommand()
{
}

FileManagerCommand *FileManagerCommand::getInstance()
{
    static FileManagerCommand instance;
    return &instance;
}

// void FileManagerCommand::init(adrSystem_component* padrsystemcom)
// {
//     m_l3FileManagerInstance.setAdrSystem(padrsystemcom);
// }

void FileManagerCommand::setFileManagerCfgPath(string fileManagerCfgPath)
{
    m_l3FileManagerInstance.setFileManagerCfgPath(fileManagerCfgPath);
    return;
}

string FileManagerCommand::saveFile(int level, string fileName)
{
    // sleep(10);
    // auto func = [=]()
    // {
    return m_l3FileManagerInstance.saveFile(level, fileName);
    // };
    // this->appendEvent(EventLoop::getFileManagerInstance(), func);
}
void FileManagerCommand::delFileUploadSuccess(string fileName)
{
    return m_l3FileManagerInstance.delFileUploadSuccess(fileName);
}
